package openbang.account.service.entity;


import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.NotPersistent;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;


import com.google.gwt.user.client.rpc.IsSerializable;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * 调查项目定义
 * 
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class DiaoChaProject implements IsSerializable,Serializable {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;

	@Persistent
	private String code;

	@Persistent
	private String title;

	@Persistent
	private String description;
	
	@Persistent
	private Date creation=new Date();

	@Persistent
	private Date beginDate =new Date();
	
	@Persistent
	private Date endDate =new Date();

	@Persistent
	private String email ="";

	
	@Persistent
	private Date updTime= new Date();
	
	@NotPersistent
	private List<DiaoChaItem> items = new ArrayList<DiaoChaItem>();

    public DiaoChaProject() {
    }

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getCreation() {
		return creation;
	}

	public void setCreation(Date creation) {
		this.creation = creation;
	}


	public Date getUpdTime() {
		return updTime;
	}

	public void setUpdTime(Date updTime) {
		this.updTime = updTime;
	}

	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}	
	
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public List<DiaoChaItem> getItems() {
		return items;
	}

	public void setItems(List<DiaoChaItem> items) {
		this.items = items;
	}

	public void addItem(DiaoChaItem item){
		getItems().add(item);
	}

}